# -*- coding: utf-8 -*-
import zipfile
import pytest
import os
from utils.zip_file import zip_file
from utils.email import Email
if __name__ == '__main__':

    os.system(r'del /s /q ..\allure-report\*.*')
    os.system(r'del /s /q ..\allure-results\*.*')
    os.system(r'del /s /q ..\allure-zip-report\*.*')
    #运行用例
    pytest.main(['-s', '-q', '--alluredir', '../allure-results/', '-W ignore::DeprecationWarning'])
    # # 生成测试报告
    os.system('allure generate ../allure-results/ -o ../allure-report/ --clean')
    #压缩测试报告
    zip_file('../allure-report','../allure-zip-report/report.zip')
    #发送邮件
    Email().send_email()